<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c"
           uri="http://java.sun.com/jsp/jstl/core" %>
<c:set value="<%=request.getContextPath()%>" var="path"/>
<html>
<head>
    <meta charset="UTF-8">
    <script src="/js/jquery-1.11.2.js"></script>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <title>Hello</title>
</head>
<body>

<div>

    <h1>hello!${name}</h1>

    <form action="login.do">
        <input type="text" id="username"/>
        <input type="text" id="password"/>
        <a href="javascript:void(0)" id="login" data-id="123">登陆</a>
    </form>
</div>
<script>
    $(document).ready(function () {
        $("#login").on('click', function () {

            var data = {
                username: $('#username').val(),
                password: $('#password').val()
            };

            $.ajax({
                url: 'confirmLogin.do',
                data: data,
                success: function (result) {
                    alert(result);
                }
            });
        });
    })
    ;
</script>
</body>

</html>
